main(a,b,c,d,e,f){double r;for(gets(&a);~scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);printf("%.4lf\n",r)){r=sqrt((a-d)*(a-d)+(b-e)*(b-e))-c-f;r=r<0?0:r;}}
